<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/">
  <xi:include href="sqa_nav.html" />

  <head>
    <title>Test Logs</title>
  </head>

  <body>
  	<h2>Testing Log Results</h2>
	<form id="logsearchform" method="post" action="">
		<fieldset>
		  <legend>Select Test Log Search Critera</legend>
			<div id="searchList">
				<div py:for="item in index" id="log_search" >
					<label for="item.name">${item.label}:</label> 
					<select id="${item.name}" name="${item.name}" >
						<option value="NoValue" selected="true" >--Select--</option>
						<py:for each="option in item.options">					
							<option value="${option}">${option}</option>
						</py:for>
					</select>
				</div>
				<div id="log_search" >
					<label for="row_count">Row Count:</label> 
					<select id="row_count" name="row_count" >
						<option value="20" selected="true" >20</option>
						 <option value="40">40</option>
						 <option value="60">60</option>
						 <option value="80">80</option>
						 <option value="100">100</option>
					</select>
				</div>
			</div>
			<div>
				<div id="log_search">
					<input type="submit" name="sqa_control" value="${_('Search Logs')}" />
				</div>
				<div id="log_search">
					<input type="reset" value="Reset Search Critera" />
				</div>
			</div>
			
		</fieldset>
	</form>
	<py:choose test="result_num">
	 <py:when test="0">
		<div>
			<p>No Results Found</p>
		</div>
	 </py:when>
	 <py:otherwise>
		<table class="listing">	
		<thead>
		<tr>
			<th style="width: 30px;">Details</th>
			<th>Milestone</th>
			<th>Plan Name</th>
			<th>Test Type</th>
			<th>Tester Name</th>
			<th>Last Run</th>			
		</tr>
		</thead>
		<py:for each="log in logset" >
			<tr id="row_${log.reg_id}">
				<td><input type="radio" name="show_detail" reg_num='${log.reg_id}'/></td>
				<td>${log.milestone}</td>
				<td>${log.plan_name}</td>
				<td>${log.test_type}</td>
				<td>${log.tester}</td>
				<td>${log.last_run}</td>
			</tr>
			<tr id="detail_${log.reg_id}" style="display: none;">
				<td colspan="10">
					<div>
						<h3>Test Registration Number: ${log.reg_id}</h3>
					</div>
					<div> 
					 <table class="listing">
						<tr>
							<thead>
								<th colspan="2">Client Attributes</th>
							</thead>
						</tr>
						<tr>
							<thead>
								<th>Name</th>
								<th>Value</th>
							</thead>
						</tr>
						<tr>
							<td>Browser</td><td>${log.test_detail.browser_info.browser}</td>
						</tr><tr>
							<td>Browser Version</td><td>${log.test_detail.browser_info.version}</td>
						</tr><tr>
							<td>User Agent</td><td>${log.test_detail.browser_info.user_agent}</td>
						</tr><tr>
							<td>Client Platform</td><td>${log.test_detail.client_info.client_platform}</td>
						</tr>
					 </table>
					</div>					
					<div>
						<fieldset><legend>Testing Conditions</legend>
						${log.test_condition}
						</fieldset>
						</div>
					<div>
						<fieldset><legend>Comments</legend>
						${log.test_comments}
						</fieldset>
						</div>
					<div id="_log_detail_${log.reg_id}"></div>
				</td>
						
			</tr>
			
		</py:for>
		</table>
	 </py:otherwise>
	</py:choose>
  </body>
</html>












